package ee.siimkaspar.subjects.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Entity
@Table(name = "ent_per_relation_type")
public class EntPerRelationType implements Serializable, ModelInterface {

	@Id
	@Column(name = "ent_per_relation_type", unique = true, nullable = false)
	private Integer id;
	@Column(name = "type_name", length = 200)
	private String typeName;
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "entPerRelationType")
	private List<EnterprisePersonRelation> enterprisePersonRelations = new ArrayList<EnterprisePersonRelation>();

	public EntPerRelationType() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public List<EnterprisePersonRelation> getEnterprisePersonRelations() {
		return enterprisePersonRelations;
	}

	public void setEnterprisePersonRelations( List<EnterprisePersonRelation> enterprisePersonRelations) {
		this.enterprisePersonRelations = enterprisePersonRelations;
	}
	@Override
	public boolean validate() {
		// TODO Auto-generated method stub
		return true;
	}
}
